"*************************************************************************
" Description: My VIM configuration for Linux/Windows, Console/GUI
" Author: He Wei Ping (hwp195)
" Create: 2012年03月12日
" Last Modified: Friday 08/25/2023 20:05:01
" Modified Times: 274
"*************************************************************************

""" 自动安装 plug.vim 插件,是一个插件自动管理器
let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim'
if empty(glob(data_dir . '/autoload/plug.vim'))
silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs  https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif

" Specify a directory for plugins
" - For Neovim: stdpath('data') . '/plugged'
" - Avoid using standard Vim directory names like 'plugin'
call plug#begin('~/.vim/plugged')
" Make sure you use single quotes

" Vim 终端图标
Plug 'ryanoasis/vim-devicons'

" 状态栏插件 
Plug 'bling/vim-airline'
Plug 'vim-airline/vim-airline-themes'


" 快速进行对齐/格式化
Plug 'junegunn/vim-easy-align'

" 嵌套括号高亮
Plug 'luochen1990/rainbow'

" 生成函数大纲
Plug 'preservim/tagbar'

" monokai主题
Plug 'crusoexia/vim-monokai'
" gruvbox主题
Plug 'gruvbox-community/gruvbox'

" 动态语法检测工具
Plug 'dense-analysis/ale'
" Any valid git URL is allowed
Plug 'https://github.com/junegunn/vim-github-dashboard.git'

" 按需加载，表明只有在 NERDTreeToggle 命令被调用时, 对应的插件才会被加载；
Plug 'preservim/nerdtree', {'on': 'NERDTreeToggle'}
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'

" 智能补全插件 coc
Plug 'neoclide/coc.nvim', {'branch': 'release'}

"vim-go
Plug 'fatih/vim-go', { 'tag': '*' }

"MarkDown Vim Mode, 语法高亮，规则匹配等
Plug 'godlygeek/tabular'
Plug 'preservim/vim-markdown'

"Better JSON for VIM
Plug 'elzr/vim-json'

"补全函数时在命令栏显示函数签名
Plug 'Shougo/echodoc.vim'

"多光标编辑
Plug 'terryma/vim-multiple-cursors'

"让翻页更顺畅
Plug 'terryma/vim-smooth-scroll'

"vim打字机效果
Plug 'skywind3000/vim-keysound'

" AI 插件 tabnine
Plug 'codota/tabnine-nvim', { 'do': './dl_binaries.sh' }

call plug#end()



""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"        Key Mapping
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
map ,e :e $MYVIMRC<CR>
map ,ma :!man
map ,bn :bn<CR>
map ,bd :bd<CR>
map ,bl :%s/\s\+$//<CR> "Delect Extra spaces in the end of each line
iab xdate <c-r>=strftime("%Y-%m-%d %H:%M:%S")<CR>
nmap <C-K> :!sdcv <C-R>=expand("<cword>")<CR>
map ,bu :BufExplorer<CR>
"map <F5> :GoRun %<CR>
nnoremap <F5> :w<CR>:!gcc % -o %< && ./%<<CR> 

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""" 设置代码折叠
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set nofoldenable           " 设置成打开文件时就打开所有可折叠地方
set foldmethod=syntax       " 设置语法折叠
set foldcolumn=0            " 设置折叠区域的宽度
setlocal foldlevel=1        " 设置折叠层数为
nnoremap <space> @=((foldclosed(line('.')) < 0) ? 'zc' : 'zo')<CR>

"保存上次浏览光标位置
autocmd BufReadPost * if line("'\"") && line("'\"") <= line("$") | exe "normal `\"" | endif
"Auto imports packages on save
autocmd BufWritePre *.go :GoImports 
"Auto format text
"autocmd BufWritePre * call AutoFormat()
"Auto save the time last modified and times
autocmd BufWritePre,FileWritePre *vimrc   ks|call LastMod()|'s


""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
">>>>>>>>>>>>>>>>>>>>>>   My configuration   <<<<<<<<<<<<<<<<<<<<<<<<<<<<<
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
colorscheme monokai
"colorscheme gruvbox
syntax on
set encoding=utf-8
set expandtab               " 使用空格替代Tab
set tabstop=4               " ts
set shiftwidth=4            " tw Number of spaces to use for each step of (auto)indent.
set autoindent
set cindent                 " Enables automatic C program indenting.
set cinoptions=:s,ps,ts,cs
set cinwords=if,else,while,do,for,switch,case
set scrolloff=3             " Scrolloff
set nocompatible            " No Vi-compatibl
set autoread                " Auto reload file when be changed outside
set autowriteall            " Auto write when change buffer
set wildmenu                " Auto match the command line your input by <Tab>
set cursorline              " Highlight the screen line of the cursor with CursorLin
set number                  " Display line number
set showcmd         " Show the current command in the lower right corner
set mouse=h                 " Enable full mouse support in the console.
set mousehide               " Hiden the mouse when inserting mode
set fillchars=""            " Get rid of the silly characters in window separators
set cpoptions+=$            " Have nice $ sign when you use `cw`
set nobackup                " Do not make a backup before overwriting a file.
set hidden                  " 允许在有未保存的修改时切换缓冲区，此时的修改由vim负责保存
set ignorecase smartcase    " 搜索时忽略大小写，但在有一个或以上大写字母时仍保持对大小写敏感
set nowrapscan              " 禁止在搜索到文件两端时循环搜索
set incsearch               " 边输入搜索内容时就自动跳到匹配字符串处
set hlsearch                " 搜索时高亮显示被找到的文本
set magic                   " 设置当命令行里有正则表达式符号时需要用转义符\标示
set guioptions-=T           " 隐藏工具栏
set guioptions-=m           " 隐藏菜单栏
set cmdheight=1             " 设定命令行的行数为 1
set wrap                    " 自动换行
set linebreak               " 整词换行，英文单词在换行时不被截断
set clipboard+=unnamed      " Yanks go on clipboard instead.
set textwidth=0         " Don't wrap lines by default
set wildmode=longest,list   " At command line, complete longest common string, then list alternatives.
set backspace=indent,eol,start  " more powerful backspacing
set vb t_vb=
au GuiEnter * set t_vb=

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""" Set statusline
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Display status line(default 1)
" The flow lines must be set behind "colorscheme" command,
" because colorscheme cmmand will be execute "hi clear".
"set laststatus=2
"function! InsertStatuslineColor(mode)
"    if     a:mode == 'i'
"	hi statusline guibg=DarkRed  ctermbg=DarkRed
"    elseif a:mode == 'r'
"	hi statusline guibg=Black    ctermbg=Black
"    else
"	hi statusline guibg=DarkBlue ctermbg=DarkBlue
"    endif
"endfunction
"hi User1 guifg=DarkMagenta ctermfg=DarkMagenta
"hi User2 guifg=Yellow  guibg=Blue    ctermfg=Yellow ctermbg=Blue
"au InsertEnter * call  InsertStatuslineColor(v:insertmode)
"au InsertChange * call InsertStatuslineColor(v:insertmode)
"au InsertLeave * hi statusline guibg=Black guifg=Green ctermbg=Black ctermfg=LightGreen
"set stl=[%F]\ %2*%n%m%r%h%w%*\ [FORMAT=%{&ff}:%{&fenc!=''?&fenc:&enc}]\ [TYPE=%Y]\ [COL=%v]\ [ROW=%l/%L(%p%%)]\ [ASCII:0x%B=%b]\ %1*[%{strftime(\"%H:%M:%S\")}]%*


""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""" Functions
function MySys()
if has("win32")
return "windows"
else
return "linux"
endif
endfunction

function AutoFormat()
if ((line('$') < 5000) && (&ft != 'go'))
exe "normal" "gg=G"
exe "normal" "```"
endif
endfunction

fun LastMod()
let l =  min([line('$'), 8])
exe "1," . l . "g#Last Modified: #s#Last Modified: .*#Last Modified: " . 
			\ strftime("%A %x %H:%M:%S")
exe '1,' . l . 'g/Modified Times:/s/\d\+/\=submatch(0) + 1/'
endfun


""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"""""设置系统相关
if MySys() == "windows"
let $VIMFILES = $VIM.'/vimfiles'
set guifont=DejaVu_Sans_Mono:h12:cANSI
elseif MySys() == "linux"
let $VIMFILES = $HOME.'/.vim'
endif


"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
"                   Plugins' setting                                     !
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
filetype on
filetype indent on
filetype plugin on


""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"    plugin -srcexpl.vim                                                 "
"------------------------------------------------------------------------"
nmap <F4> :SrcExplToggle<CR>

" Set the height of Source Explorer window
let g:SrcExpl_winHeight = 8

" Set 100 ms for refreshing the Source Explorer
let g:SrcExpl_refreshTime = 200

" Set "Enter" key to jump into the exact definition context
let g:SrcExpl_jumpKey = "<ENTER>"

" Set "Space" key for back from the definition context
let g:SrcExpl_gobackKey = "<SPACE>"

"let g:SrcExpl_pluginList = ["__Tag_List__","_NERD_tree_","Source_Explorer"]
let g:SrcExpl_pluginList = ["__Tag_List__","_NERD_tree_"]

" Enable/Disable the local definition searching, and note that this is not
" guaranteed to work, the Source Explorer doesn't check the syntax for now.
" It only searches for a match with the keyword according to command 'gd'
let g:SrcExpl_searchLocalDef = 1

" Use 'Exuberant Ctags' with '--sort=foldcase -R .' or '-L cscope.files' to
"  create/update a tags file
"let g:SrcExpl_updateTagsCmd = "ctags --sort=foldcase -R ."

" Set "<F5>" key for updating the tags file artificially
let g:SrcExpl_updateTagsKey = "<F5>"

" Is update tags when open SrcExpl
let g:SrcExpl_isUpdateTags = 0
"------------------------------------------------------------------------"



""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"    plugin -DoxygenToolkit.vim                                          "
"------------------------------------------------------------------------"
let g:DoxygenToolkit_briefTag_pre      ="@brief:  "
let g:DoxygenToolkit_paramTag_pre      ="@param:  "
let g:DoxygenToolkit_returnTag         ="@returns:"
let g:DoxygenToolkit_licenseTag        ="Copyright (C) Infogo Technology LimitedCompany"
let g:DoxygenToolkit_briefTag_funcName ="yes"
let g:doxygen_enhanced_color           =1
let g:load_doxygen_syntax              =1
map <F12> <Esc>:Dox<cr>
nmap ,do  <Esc>:Dox<cr>
"------------------------------------------------------------------------"


""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"    plugin -go.Vim                                                      "
"------------------------------------------------------------------------"
let g:go_version_warning = 0
let g:go_highlight_functions = 1
let g:go_highlight_methods = 1
let g:go_highlight_structs = 1
let g:go_highlight_operators = 1
let g:go_highlight_build_constraints = 1
let g:go_fmt_experimental = 1
"------------------------------------------------------------------------"



""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""" plugin -NERDTree.vim
"------------------------------------------------------------------------"
map ,nt :NERDTreeToggle<CR>
nnoremap <F3> :NERDTreeToggle<CR> " 开启/关闭nerdtree快捷键
let g:NERDTreeWinSize = 25 "设定 NERDTree 视窗大小
let NERDTreeMinimalUI = 1  
let NERDTreeDirArrows = 1
let g:webdevicons_enable_nerdtree = 1
" 设置树的显示图标
let g:NERDTreeDirArrowExpandable = '+'
let g:NERDTreeDirArrowCollapsible = '-'
let NERDTreeIgnore = ['\.pyc$']  " 过滤所有.pyc文件不显示
let g:NERDTreeShowLineNumbers=0 " 是否显示行号
let g:NERDTreeHidden=0     "不显示隐藏文件
let NERDTreeShowBookmarks=1  " 开启Nerdtree时自动显示Bookmarks

" autocmd vimenter * NERDTree  "自动开启Nerdtree
"打开vim时如果没有文件自动打开NERDTree
"autocmd vimenter * if !argc()|NERDTree|endif
"当NERDTree为剩下的唯一窗口时自动关闭
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
"------------------------------------------------------------------------"


""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""" plugin - cscope_maps.vim
"------------------------------------------------------------------------"
"cscope插件热键
nmap cs :cs find s <C-R>=expand("<cword>")<CR><CR> 
nmap cg :cs find g <C-R>=expand("<cword>")<CR><CR>  
nmap cc :cs find c <C-R>=expand("<cword>")<CR><CR>  
nmap cd :cs find d <C-R>=expand("<cword>")<CR><CR>  
nmap ct :cs find t <C-R>=expand("<cword>")<CR><CR>  
nmap ce :cs find e <C-R>=expand("<cword>")<CR><CR>  
nmap cf :cs find f 
nmap ci :cs find i ^<C-R>=expand("<cfile>")<CR><CR> 
if has("cscope")
set csprg=/usr/bin/cscope
set csto=1
set cst
set csverb
if filereadable("cscope.out")
cs add cscope.out
elseif $CSCOPE_DB != ""
cs add $CSCOPE_DB
endif
set csverb
endif
"------------------------------------------------------------------------"


""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"    plugin -coc.nvim
"------------------------------------------------------------------------"
" if hidden is not set, TextEdit might fail.
set hidden
" Some servers have issues with backup files, see #649
set nobackup
set nowritebackup
 
" You will have bad experience for diagnostic messages when it's default 4000.
set updatetime=300
 
" don't give |ins-completion-menu| messages.
set shortmess+=c
 
" always show signcolumns
set signcolumn=yes

" disable inlayHint
":call coc#config("inlayHint.enable", v:false)
call coc#config("inlayHint.enableParameter", v:false)


" Use tab for trigger completion with characters ahead and navigate.
" Use command ':verbose imap <tab>' to make sure tab is not mapped by other plugin.
function! s:check_back_space() abort
  let col = col('.') - 1
  return !col || getline('.')[col - 1]  =~# '\s'
endfunction

"inoremap <silent><expr> <>
"      \ pumvisible() ? "\<C-n>" :
"      \ <SID>check_back_space() ? "\<TAB>" :
"      \ coc#refresh()
"inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
 
 
" Use <c-space> to trigger completion.
inoremap <silent><expr> <c-space> coc#refresh()
 
" Use <cr> to confirm completion, `<C-g>u` means break undo chain at current position.
" Coc only does snippet and additional edit on confirm.
inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
" Or use `complete_info` if your vim support it, like:
" inoremap <expr> <cr> complete_info()["selected"] != "-1" ? "\<C-y>" : "\<C-g>u\<CR>"
 
" Use `[g` and `]g` to navigate diagnostics
nmap <silent> [g <Plug>(coc-diagnostic-prev)
nmap <silent> ]g <Plug>(coc-diagnostic-next)
" Remap keys for gotos
nmap <silent> <C-]> <Plug>(coc-definition)
"nmap <silent> gd <Plug>(coc-definition)
nmap <silent> gy <Plug>(coc-type-definition)
nmap <silent> gi <Plug>(coc-implementation)
nmap <silent> gr <Plug>(coc-references)
 
" Use K to show documentation in preview window
nnoremap <silent> K :call <SID>show_documentation()<CR>
 
function! s:show_documentation()
  if (index(['vim','help'], &filetype) >= 0)
    execute 'h '.expand('<cword>')
  else
    call CocAction('doHover')
  endif
endfunction
 
" Highlight symbol under cursor on CursorHold
autocmd CursorHold * silent call CocActionAsync('highlight')
 
" Remap for rename current word
nmap <leader>rn <Plug>(coc-rename)
 
" Remap for format selected region
xmap <leader>f  <Plug>(coc-format-selected)
nmap <leader>f  <Plug>(coc-format-selected)
 
augroup mygroup
  autocmd!
  " Setup formatexpr specified filetype(s).
  autocmd FileType typescript,json setl formatexpr=CocAction('formatSelected')
  " Update signature help on jump placeholder
  autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp')
augroup end
 
" Remap for do codeAction of selected region, ex: `<leader>aap` for current paragraph
xmap <leader>a  <Plug>(coc-codeaction-selected)
nmap <leader>a  <Plug>(coc-codeaction-selected)
 
" Remap for do codeAction of current line
nmap <leader>ac  <Plug>(coc-codeaction)
" Fix autofix problem of current line
nmap <leader>qf  <Plug>(coc-fix-current)
 
" Create mappings for function text object, requires document symbols feature of languageserver.
xmap if <Plug>(coc-funcobj-i)
xmap af <Plug>(coc-funcobj-a)
omap if <Plug>(coc-funcobj-i)
omap af <Plug>(coc-funcobj-a)
 
" Use `:Format` to format current buffer
command! -nargs=0 Format :call CocAction('format')
 
" Use `:Fold` to fold current buffer
command! -nargs=? Fold :call     CocAction('fold', <f-args>)
 
" use `:OR` for organize import of current buffer
command! -nargs=0 OR   :call     CocAction('runCommand', 'editor.action.organizeImport')
"------------------------------------------------------------------------"


""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"    plugin -rainbow.Vim                                                      "
"------------------------------------------------------------------------"
let g:rainbow_active = 1
let g:rainbow_conf = {
\   'guifgs': ['darkorange3', 'seagreen3', 'royalblue3', 'firebrick'],
\   'ctermfgs': ['lightyellow', 'lightcyan','lightblue', 'lightmagenta'],
\   'operators': '_,_',
\   'parentheses': ['start=/(/ end=/)/ fold', 'start=/\[/ end=/\]/ fold', 'start=/{/ end=/}/ fold'],
\   'separately': {
\       '*': {},
\       'tex': {
\           'parentheses': ['start=/(/ end=/)/', 'start=/\[/ end=/\]/'],
\       },
\       'lisp': {
\           'guifgs': ['darkorange3', 'seagreen3', 'royalblue3', 'firebrick'],
\       },
\       'vim': {
\           'parentheses': ['start=/(/ end=/)/', 'start=/\[/ end=/\]/', 'start=/{/ end=/}/ fold', 'start=/(/ end=/)/ containedin=vimFuncBody', 'start=/\[/ end=/\]/ containedin=vimFuncBody', 'start=/{/ end=/}/ fold containedin=vimFuncBody'],
\       },
\       'html': {
\           'parentheses': ['start=/\v\<((area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)[ >])@!\z([-_:a-zA-Z0-9]+)(\s+[-_:a-zA-Z0-9]+(\=("[^"]*"|'."'".'[^'."'".']*'."'".'|[^ '."'".'"><=`]*))?)*\>/ end=#</\z1># fold'],
\       },
\       'css': 0,
\   }
\}
"------------------------------------------------------------------------"


""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"    plugin -vim-airline.Vim                                                      "
"------------------------------------------------------------------------"
"let g:airline_theme="luna"
let g:airline_theme="molokai"
"这个是安装字体后 必须设置此项"
let g:airline_powerline_fonts = 1
let g:webdevicons_enable_airline_tabline = 1
let g:webdevicons_enable_airline_statusline = 1
"打开tabline功能,方便查看Buffer和切换，这个功能比较不错"
"我还省去了minibufexpl插件，因为我习惯在1个Tab下用多个buffer"
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#buffer_nr_show = 1
" 关闭状态显示空白符号计数,这个对我用处不大"
let g:airline#extensions#whitespace#enabled = 0
let g:airline#extensions#whitespace#symbol = '!'
" 设置状态栏
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#left_alt_sep = '|'
let g:airline#extensions#tabline#buffer_nr_show = 0
let g:airline#extensions#tabline#formatter = 'default'
let g:airline_theme = 'desertink'  " 主题
let g:airline#extensions#keymap#enabled = 1
let g:airline#extensions#tabline#buffer_idx_mode = 1
" 设置切换tab的快捷键 <\> + <i> 切换到第i个 tab
nmap <leader>1 <Plug>AirlineSelectTab1
nmap <leader>2 <Plug>AirlineSelectTab2
nmap <leader>3 <Plug>AirlineSelectTab3
nmap <leader>4 <Plug>AirlineSelectTab4
nmap <leader>5 <Plug>AirlineSelectTab5
nmap <leader>6 <Plug>AirlineSelectTab6
nmap <leader>7 <Plug>AirlineSelectTab7
nmap <leader>8 <Plug>AirlineSelectTab8
nmap <leader>9 <Plug>AirlineSelectTab9
" 设置切换tab的快捷键 <\> + <-> 切换到前一个 tab
nmap <leader>- <Plug>AirlineSelectPrevTab
" 设置切换tab的快捷键 <\> + <+> 切换到后一个 tab
nmap <leader>+ <Plug>AirlineSelectNextTab
" 设置切换tab的快捷键 <\> + <q> 退出当前的 tab
nmap <leader>q :bp<cr>:bd #<cr>
" 修改了一些个人不喜欢的字符
if !exists('g:airline_symbols')
    let g:airline_symbols = {}
endif
let g:airline_symbols.linenr = "CL" " current line
let g:airline_symbols.whitespace = '|'
let g:airline_symbols.maxlinenr = 'Ml' "maxline
let g:airline_symbols.branch = 'BR'
let g:airline_symbols.readonly = "RO"
let g:airline_symbols.dirty = "DT"
let g:airline_symbols.crypt = "CR"
"------------------------------------------------------------------------"


""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"    plugin -Tagbar.Vim                                                  "
"------------------------------------------------------------------------"
let g:tagbar_autofocus=0
let g:tagbar_zoomwidth = 1
let g:tagbar_indent = 1
let g:tagbar_show_data_type = 1
let g:tagbar_show_visibility = 0
let g:tagbar_width = max([25, winwidth(0) / 5])
nmap ,ta :TagbarToggle<CR>
autocmd BufReadPost *.cpp,*.c,*.h,*.cc,*.cxx call tagbar#autoopen(1)
"------------------------------------------------------------------------"

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"    plugin -keysound.Vim                                                "
"------------------------------------------------------------------------"
"要求VIM 支持Python特性
let g:keysound_enable = 0
let g:keysound_theme = 'default'
let g:keysound_py_version = 3
let g:keysound_volume = 500
"------------------------------------------------------------------------"

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"    plugin -nerdtree-git.Vim                                                "
"------------------------------------------------------------------------"
let g:NERDTreeGitStatusUseNerdFonts = 1 " you should install nerdfonts by yourself. default: 0
let g:NERDTreeGitStatusIndicatorMapCustom = {
                \ 'Modified'  :'✹',
                \ 'Staged'    :'✚',
                \ 'Untracked' :'✭',
                \ 'Renamed'   :'➜',
                \ 'Unmerged'  :'═',
                \ 'Deleted'   :'✖',
                \ 'Dirty'     :'✗',
                \ 'Ignored'   :'☒',
                \ 'Clean'     :'✔︎',
                \ 'Unknown'   :'?',
                \ }
"------------------------------------------------------------------------"



""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"    plugin -echodoc.vim                                                 "
"------------------------------------------------------------------------"
" Or, you could use vim's popup window feature.
let g:echodoc#enable_at_startup = 1
let g:echodoc#type = 'popup'
" To use a custom highlight for the popup window,
" change Pmenu to your highlight group
highlight link EchoDocPopup Pmenu
"------------------------------------------------------------------------"




""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""" plugin - ale 语法检测
"------------------------------------------------------------------------"
nmap ,al :ALEToggle<CR>
let g:ale_sign_column_always = 1
let g:ale_sign_error = '✗'
let g:ale_sign_warning = 'w'
let g:ale_statusline_format = ['✗ %d', '⚡ %d', '✔ OK']
let g:ale_echo_msg_format = '[%linter%] %code: %%s'
let g:ale_lint_on_text_changed = 'normal'
let g:ale_lint_on_insert_leave = 1
let g:ale_c_gcc_options = '-Wall -O2 -std=c99'
let g:ale_cpp_gcc_options = '-Wall -O2 -std=c++14'
let g:ale_c_cppcheck_options = ''
let g:ale_cpp_cppcheck_options = ''
let g:ale_completion_autoimport = 1
let g:ale_completion_enabled = 1
" show errors or warnings in my statusline
let g:airline#extensions#ale#enabled = 1
" use quickfix list instead of the loclist
let g:ale_set_loclist = 0
let g:ale_set_quickfix = 1
"------------------------------------------------------------------------"


"<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
">>>>>>>>>>>>>>>>>>>>      End Of Vimrc     <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

